package org.darkforest.model;

import org.darkforest.common.util.DateUtil;
import org.darkforest.common.util.Page;

public class Message extends Page<Message> {
    private Integer messageId;

    private Integer messageParentId;

    private Integer fromMemberId;

    private String toMemberId;

    private String messageTitle;

    private String messageBody;

    private Integer messageTime;

    private Integer messageUpdateTime;

    private Integer messageOpen;

    private Integer messageState;

    private Integer messageType;

    private String readMemberId;

    private String delMemberId;

    private Integer messageIsmore;

    private String fromMemberName;

    private String toMemberName;

    private Integer messageClass; //0 系统信息 1 优惠信息 2提醒信息

    public Integer getMessageClass() {
        return messageClass;
    }


    public Message() {

    }

    public String getMessageTimeStr(){
        return DateUtil.toIntDateString(this.messageTime);
    }

    /**
     * 根据接收人ID 以及 消息类型查询
     * @param toMemberId
     * @param messageClass
     */
    public Message(String toMemberId, Integer messageClass) {
        this.toMemberId = toMemberId;
        this.messageClass = messageClass;
    }

    /**
     * 根据接收人ID 以及 消息类型查询
     * @param toMemberId
     * @param messageClass
     * @param p 开始页
     */
    public Message(String toMemberId, Integer messageClass,int p,int pageSize) {
        this.toMemberId = toMemberId;
        this.messageClass = messageClass;
        super.setStart(p);
        super.setPageSize(pageSize);
    }


    public Message(Integer messageId,Integer messageOpen) {
        this.messageOpen = messageOpen;
        this.messageId = messageId;
    }

    public void setMessageClass(Integer messageClass) {
        this.messageClass = messageClass;
    }

    public Integer getMessageId() {
        return messageId;
    }

    public void setMessageId(Integer messageId) {
        this.messageId = messageId;
    }

    public Integer getMessageParentId() {
        return messageParentId;
    }

    public void setMessageParentId(Integer messageParentId) {
        this.messageParentId = messageParentId;
    }

    public Integer getFromMemberId() {
        return fromMemberId;
    }

    public void setFromMemberId(Integer fromMemberId) {
        this.fromMemberId = fromMemberId;
    }

    public String getToMemberId() {
        return toMemberId;
    }

    public void setToMemberId(String toMemberId) {
        this.toMemberId = toMemberId == null ? null : toMemberId.trim();
    }

    public String getMessageTitle() {
        return messageTitle;
    }

    public void setMessageTitle(String messageTitle) {
        this.messageTitle = messageTitle == null ? null : messageTitle.trim();
    }

    public String getMessageBody() {
        return messageBody;
    }

    public void setMessageBody(String messageBody) {
        this.messageBody = messageBody == null ? null : messageBody.trim();
    }

    public Integer getMessageTime() {
        return messageTime;
    }

    public void setMessageTime(Integer messageTime) {
        this.messageTime = messageTime == null ? null : messageTime;
    }

    public Integer getMessageUpdateTime() {
        return messageUpdateTime;
    }

    public void setMessageUpdateTime(Integer messageUpdateTime) {
        this.messageUpdateTime = messageUpdateTime == null ? null : messageUpdateTime;
    }

    public Integer getMessageOpen() {
        return messageOpen;
    }

    public void setMessageOpen(Integer messageOpen) {
        this.messageOpen = messageOpen;
    }

    public Integer getMessageState() {
        return messageState;
    }

    public void setMessageState(Integer messageState) {
        this.messageState = messageState;
    }

    public Integer getMessageType() {
        return messageType;
    }

    public void setMessageType(Integer messageType) {
        this.messageType = messageType;
    }

    public String getReadMemberId() {
        return readMemberId;
    }

    public void setReadMemberId(String readMemberId) {
        this.readMemberId = readMemberId == null ? null : readMemberId.trim();
    }

    public String getDelMemberId() {
        return delMemberId;
    }

    public void setDelMemberId(String delMemberId) {
        this.delMemberId = delMemberId == null ? null : delMemberId.trim();
    }

    public Integer getMessageIsmore() {
        return messageIsmore;
    }

    public void setMessageIsmore(Integer messageIsmore) {
        this.messageIsmore = messageIsmore;
    }

    public String getFromMemberName() {
        return fromMemberName;
    }

    public void setFromMemberName(String fromMemberName) {
        this.fromMemberName = fromMemberName == null ? null : fromMemberName.trim();
    }

    public String getToMemberName() {
        return toMemberName;
    }

    public void setToMemberName(String toMemberName) {
        this.toMemberName = toMemberName == null ? null : toMemberName.trim();
    }
}